<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>南京大学职业咨询室预约平台</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='assets/i/ico_128X128.ico') }}">
    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">
    <link rel="icon" sizes="192x192" href="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="apple-touch-icon-precomposed" href="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <!-- Tile icon for Win8 (144x144 + tile color) -->
    <meta name="msapplication-TileImage" content="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <meta name="msapplication-TileColor" content="#0e90d2">

    <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/amazeui.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/app.css', v='1.4') }}">
    <script src="{{ url_for('static', filename='assets/js/jquery.min.js') }}"></script>
    <script src="{{ url_for('static', filename='assets/js/amazeui.min.js') }}"></script>
    <style>
    .am-cf {
        text-align: center;
        float: none;
    }
    
    .main {
        margin:100px 0 0 0;
        text-align: center;
    }

    .main table tr td {
        border-top:0;
    }

    .verify table tr td {
        border-top:0;
    }
        .content .main input{
        font-size:14px;
     }
    </style>
</head>

<body>
<div class="header">
    <!--<div class="header-back" onclick="history.back()">返回</div>-->
    <div class="header-title">登录账号</div>
</div>
<div class="content">
    <div class="alert alert-warning">
        {% with messages = get_flashed_messages() %}
        {% if messages %}
        <ul class=flashes>
            {% for message in messages %}
            <div class="am-alert am-alert-secondary" data-am-alert>
                <button type="button" class="am-close">&times;</button>
                <div style="text-align: center;">{{ message }}</div>
            </div>
            {% endfor %}
        </ul>
        {% endif %}
        {% endwith %}
    </div>
    <div class="main">
        <form name="njusub" method="post" onsubmit="return checkInput()">
            {{ form.csrf_token }}
            <div class="am-center">
                <table class="am-table am-table-centered" id="table1" cellpadding="0" cellspacing="0"
                       style="border:none;">
                    <tr>
                        <td>&nbsp;</td>
                        <td><label>手机号</label></td>
                        <td><input type="text" class="am-form-field" name="contact" id="contact" value="{{coct}}"
                                   style="width:100%;height:100%;" placeholder="手机号为登录和查询账号"></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><label>密&nbsp;&nbsp;&nbsp;&nbsp;码</label></td>
                        <td><input type="password" class="am-form-field" name="password" id="password" value="{{copw}}"
                                   style="width:100%;height: 100%;" autocomplete="off" placeholder="密码不能少于6位，请牢记">
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>
                          <label style="float:left;">
                            <input type="checkbox" {{corm}} id="rememberme" name="rememberme">&nbsp;记住密码
                          </label>
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </div>
            <div>&nbsp;</div>
            <div class="am-cf">
                <button type="submit" id="loginpb" value="登录" onclick="return login();"
                        class="am-btn am-btn-primary">&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;
                </button>
                <button type="submit" id="forgetpw" value="忘记密码" onclick="return forget_pd();"
                        class="am-btn am-btn-default">忘记密码
                </button>
            </div>
        </form>
    </div>
</div>

<div class="footer">
    <ul>
        <li><a href="/get_teacher_schedule" class="footer-item">预约咨询</a></li>
        <li><a href="/urgent_booking" class="footer-item">紧急咨询</a></li>
        <li><a href="/student_query_login_student" class="footer-item on">我的预约</a></li>
        <li><a href="/get_consultant_story_page" class="footer-item">咨询室故事</a></li>
        <li><a href="/index" class="footer-item">返回首页</a></li>
    </ul>
</div>

<script type="text/javascript">
    function login(){
        if (checkIsTeleNum($("#contact").val())) {
            document.njusub.action="/directed_login_student";
            document.njusub.submit();
        } else {
            alert("请输入正确的电话号码！");
            return false;
        };
    }

    function forget_pd () {
        if (checkIsTeleNum($("#contact").val())) {
            document.njusub.action="/forget_password";
            document.njusub.submit();
        } else {
            alert("请输入正确的电话号码！");
            return false;
        };
    }

    function checkIsTeleNum(a) {
        var validTeleNum = /^0?1[3|4|5|7|8][0-9]\d{8}$/;
        return validTeleNum.test(a);
    }

    function checkInvalidPassword(a) {
        if (a == undefined || a.length < 6) {
            return false;
        };
        return true;
    }

    function checkInput() {
        return true;
    }

</script>

</body>
</html>
